import { DICTIONARY_INCREMENT,DICTIONARY_DECREMENT } from '../constants/ActionTypes'

export function increment(){
    return {
        type: DICTIONARY_INCREMENT
    }
}

export function decrement(){
    return {
        type: DICTIONARY_DECREMENT
    }
}

export function incrementAsync(delay = 1000) {
    // return dispatch => {
    //     setTimeout(() => {
    //         dispatch(increment())
    //     }, delay)
    // }
    return (dispatch, getState) => {
        console.log(getState())
        setTimeout(() => {
            return dispatch({
                type:DICTIONARY_INCREMENT
            })
        }, delay)
    }
    // return {
    //     type: DICTIONARY_INCREMENT
    // }
}